require "dragulator/version"
require "engtagger"

class Dragulator
	ADJECTIVES = %w(busted fierce fishy shady sickening ugly dusty fabulous gorgeous tired )
	CATCH = %w(Momma! Hunty. Ms.\ Thang. Haleloo! Echa\ Pa'\ Lante! BAM! Now,\ Sashay\ Away. Now\ I've\ had\ it,\ oficially!)
	

	def initialize
		@tag = EngTagger.new
	end

	def transform(string)
		string.downcase!
		user_input_tags = @tag.add_tags(string)

		grab_adjectives = @tag.get_adjectives(user_input_tags).keys
		grab_adjectives.each do |adj|
			string.gsub!(/#{adj}/, adjective(rand(1..100)))
		end

		split_sentence = string.split(" ")
		split_sentence << catch_phrase(rand(1..100))
		split_sentence.first.capitalize!
		split_sentence.join(" ")
		
	end
	
	def adjective(i)
		ADJECTIVES[ i % ADJECTIVES.length]
	end

	def catch_phrase(i)
		CATCH[ i % CATCH.length]
	end

end
